package demo1;

public class Animal {
    public String name;
    public int age;
    public Animal() {
        System.out.println("Animal()的构造方法");
    }
    public Animal(String name,int age) {
        this.name = name;
        this.age = age;
        System.out.println("Animal构造方法被调用了");
    }
    public void eat() {
        System.out.println(this.age+"岁的"+this.name+"正在吃");
    }
    public void run() {
        System.out.println(this.age+"岁的"+this.name+"正在跑");
    }
}
